/*

 * Created on 2005-1-13

 *

 * TODO To change the template for this generated file go to

 * Window - Preferences - Java - Code Style - Code Templates

 */

package com.eaoa.utils;

import java.io.IOException;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.lang.StringUtils;

/**
 * 
 * @author hardy.wu
 * 
 * 
 * 
 *         TODO To change the template for this generated type comment go to
 *         Window -
 * 
 *         Preferences - Java - Code Style - Code Templates
 * 
 */

public class GetEmployeeaccountServlet extends HttpServlet {

	protected void doGet(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {

		try {
			request.setCharacterEncoding("UTF-8");
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}

		String q = request.getParameter("q");
		String projectcustomer = request.getPathInfo();

		projectcustomer = StringUtils.replace(projectcustomer, "/", "");

		String r = "";

		if (StringUtils.isNotBlank(q)) {

			GetEmployeeaccountBO bo = new GetEmployeeaccountBO(q,
					projectcustomer);
			bo.execute();

			r = bo.getR();
		}

		response.setContentType("text/html; charset=UTF-8");
		response.setHeader("Cache-Control", "no-cache");
		PrintWriter pw = response.getWriter();
		pw.write(r);
		pw.close();

	}

}